package com.cjx.myself.controller.rce;

import com.cjx.myself.service.rce.RceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/rce/runtime")
public class RuntimeController {

    @Autowired
    private RceService rceService;


    @RequestMapping("/rce1")
    public String rce1(String cmd) throws IOException {
        return rceService.rce4(cmd);
    }


    @RequestMapping("/rce2")
    public String rce2(String cmd) throws IOException {
        return rceService.rce5(cmd);
    }


    @GetMapping("/rce3")
    public void rce3(String file) throws IOException {
        rceService.rce6(file);
    }


    @GetMapping("/rce4")
    public void rce4(String cmd) throws IOException {
        rceService.rce7(cmd);
    }


}
